package com.evil.common.account.dto.user;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
 * 用户企业
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserEnterpriseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "企业id不能为空")
    private Long enterpriseId;

    @NotNull(message = "用户id不能为空")
    private Long userId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserEnterpriseDTO that = (UserEnterpriseDTO) o;
        return Objects.equals(enterpriseId, that.enterpriseId) &&
                Objects.equals(userId, that.userId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(enterpriseId, userId);
    }
}
